package com.freely.util;

import java.io.File;
import java.util.Date;
import java.util.Random;
import java.util.UUID;

public class CommonUtil {
	public static final String userImageInitializationLocation = CommonUtil.imagePath + File.separator + "0" + File.separator + "0" + File.separator + "09C6AEC6C0BD4985A170D70983B3731E.jpg";
	public static final String groupImageInitializationLocation = CommonUtil.imagePath + File.separator + "0" + File.separator + "0" + File.separator + "5F9053E3F15F434A8D6D914059E14446.jpg";
	public static final int imageMaxSize = 1024 * 100;
	public static final String imagePath = "e:" + File.separator + "freelyImage";
	
	// 生成随机数
	public static String randomNumber(int num) {
		Random random = new Random();
		Double temp = random.nextDouble();
		while(temp < 0.1) {
			temp = temp * Math.pow(10, 1);
		}
		Double value = temp * Math.pow(10, num);
		Long round = Math.round(value);
		System.out.println(temp + "    " + value + round);
		return round.toString();
	}
	
	public static String getUUID() {
		return UUID.randomUUID().toString().replaceAll("-", "").toUpperCase();
	}
}
